package com.dsy.xiangcun_manage.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import com.dsy.tools.entity.TbCity;
import com.dsy.xiangcun_manage.service.ITbCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dsy
 * @since 2019-12-29
 */
@Controller
@RequestMapping("/city")
public class TbCityController {

    @Autowired
    ITbCityService tbCityService;

    @RequestMapping("/getCityById")
    @ResponseBody
    public List<TbCity> getCityById(String provinceId){
        System.out.println(provinceId);
        QueryWrapper<TbCity> wrapper = new QueryWrapper<>();
        wrapper.eq("province_id",provinceId);
        List<TbCity> specList = tbCityService.list(wrapper);
        return specList;
    }

}
